﻿
using System.Windows;
using System.Windows.Input;

namespace LYR_RPA.dialog
{
    /// <summary>
    /// DialogBox.xaml 的交互逻辑
    /// </summary>
    public partial class DialogBox : Window
    {

        

        public DialogBox()
        {
            InitializeComponent();
        }

        public void ShowMessage(string title,string content)
        {
            
            Title.Text = title;
            Content.Text = content;
            ok.Visibility = Visibility.Collapsed;
            ShowDialog();
            
        }
        public void ShowMessage(string title,string content,string button)
        {
            Title.Text = title;
            Content.Text = content;
            if (content.Length<50)
            {
                Content.TextAlignment = TextAlignment.Center;
                Content.VerticalContentAlignment = VerticalAlignment.Center;
            }
            ok.Content = button;
            ShowDialog();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Minimize_Click(object sender, RoutedEventArgs e)
        {
            WindowState = WindowState.Minimized;
        }

        private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e)
        {
            // 在调用 DragMove 之前检查鼠标按钮的状态
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                DragMove();
            }
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
